package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.query.QueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface StrategyCommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StrategyComment record);

    StrategyComment selectByPrimaryKey(Long id);

    List<StrategyComment> selectAll();

    int updateByPrimaryKey(StrategyComment record);

    List<StrategyComment> selectForList(QueryObject qo);

    List<StrategyComment> selectForAppList(QueryObject qo);

    void insertRelation(@Param("tagId") Long tagId, @Param("commentId") Long commentId);

    void updateState(@Param("id") Long id, @Param("state") Integer state);

    /**
     * 获取某编攻略下的某条评论
     * @param qo
     * @return
     */
    StrategyComment getByStrategyIdAndCommentId(QueryObject qo);

    int selectLoveForId(Long typeId);

    void updateLove(@Param("typeId") Long typeId, @Param("loveNum") int loveNum);

    /**
     * 根据用户id查询所有攻略评论
     * @param qo
     * @return
     */
    List<Map> selectStrtegyByUserId(QueryObject qo);

    /**
     * 获取攻略评论的详情
     * @param commentId
     * @return
     */
    StrategyComment selectCommentDetail(Long commentId);

    /**
     * 他的点评
     * @param qo
     * @return
     */
    List<StrategyComment> selectStrtegyUserId(QueryObject qo);
}